package com.hlhj.carview.utils

import android.content.Context
import android.widget.Toast

/**
 * Created by Never Fear   on 2019\1\4 0004.
Never More....
 */
object ToastUtil {
    private var toast:Toast?=null
    fun toast(str:String,c:Context){
        if (toast==null){
            toast = Toast.makeText(c, null, Toast.LENGTH_SHORT)
            toast?.setText(str)
            toast?.show()
            Thread(Runnable {
                Thread.sleep(2500)
                toast=null
            }).start()
        }else{
            toast?.setText(str)
        }

    }
}